const express = require("express");

const router = express.Router();

const detailModel = require("../../model/detailModel");

router.get("/newsdetail", (req, res) => {
    let { id } = req.query;
    detailModel
        .getNewsDetail({ id })
        .then((data) => {
            res.send({
                code: 200,
                msg: "获取新闻详情成功",
                data,
            });
        })
        .catch((err) => {
            res.send({
                code: -2,
                msg: "获取新闻详情失败",
                err,
            });
        });
});

module.exports = router;
